/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.support.component;

import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.ListView;
import android.widget.TextView;
import com.qihoo.gamecenter.sdk.common.d.a.a;
import com.qihoo.gamecenter.sdk.common.i.s;
import java.util.ArrayList;
import java.util.List;

public class SuggestView extends LinearLayout {
    private com.qihoo.gamecenter.sdk.support.d.a a;
    private List b;
    private com.qihoo.gamecenter.sdk.support.a.a c;
    private TextView d;

    public SuggestView(Context paramContext, TextView paramTextView) {
        super(paramContext);
        a(paramTextView);
    }

    private void a(TextView paramTextView) {
        this.d = paramTextView;
        this.a = com.qihoo.gamecenter.sdk.support.d.a.a(this.mContext);
        a();
    }

    private void a() {
        setOrientation(1);
        setBackgroundDrawable(this.a.a(-1073741777));
        setVisibility(8);
        setOnClickListener(new View.OnClickListener() {
            public void onClick(View paramView) {}
        });
        TextView localTextView = new TextView(this.mContext);
        localTextView.setLayoutParams(new LinearLayout.LayoutParams(-1, s.b(this.mContext, 25.0F)));
        localTextView.setText(com.qihoo.gamecenter.sdk.common.d.a.a(a.a.gw));
        localTextView.setTextSize(1, s.a(this.mContext, 13.7F));
        localTextView.setPadding(s.b(this.mContext, 15.0F), 0, 0, 0);
        localTextView.setBackgroundColor(-24);
        localTextView.setTextColor(-1810350);
        localTextView.setGravity(16);
        addView(localTextView);
        View localView = new View(this.mContext);
        localView.setLayoutParams(new LinearLayout.LayoutParams(-1, 1));
        localView.setBackgroundColor(-4737097);
        addView(localView);
        ListView localListView = new ListView(this.mContext);
        localListView.setLayoutParams(new LinearLayout.LayoutParams(-1, -2));
        this.b = new ArrayList();
        this.c = new com.qihoo.gamecenter.sdk.support.a.a(this.mContext, this.b);
        localListView.setAdapter(this.c);
        localListView.setDivider(new ColorDrawable(-4737097));
        localListView.setDividerHeight(1);
        localListView.setHeaderDividersEnabled(false);
        localListView.setFooterDividersEnabled(false);
        localListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            public void onItemClick(AdapterView paramAdapterView, View paramView, int paramInt, long paramLong) {
                String str = SuggestView.a(SuggestView.this).a(paramInt);
                if (SuggestView.b(SuggestView.this) != null)
                    SuggestView.b(SuggestView.this).setText(str);
                SuggestView.this.setVisibility(8);
            }
        });
        addView(localListView);
    }
}